const express = require('express');
const router = express.Router();
const NotificationController = require('../controllers/NotificationController');
const { authenticateToken, requireAdmin, requireTeacher } = require('../middleware/auth');

// 用户通知路由
router.get('/', authenticateToken, NotificationController.getNotifications);
router.get('/unread-count', authenticateToken, NotificationController.getUnreadCount);
router.put('/:id/read', authenticateToken, NotificationController.markAsRead);
router.put('/all/read', authenticateToken, NotificationController.markAsRead);
router.delete('/:id', authenticateToken, NotificationController.deleteNotification);
router.delete('/batch', authenticateToken, NotificationController.batchDeleteNotifications);

// 管理员通知路由
router.post('/system', authenticateToken, requireAdmin, NotificationController.createSystemNotification);
router.post('/course', authenticateToken, requireTeacher, NotificationController.createCourseNotification);
router.post('/payment', authenticateToken, requireAdmin, NotificationController.createPaymentNotification);
router.post('/live', authenticateToken, requireTeacher, NotificationController.createLiveNotification);

module.exports = router; 